﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Configuration;

namespace Zatify.WebUI.Controllers
{
    public class AnonymousController : Controller
    {
        [HttpGet]
        public ActionResult Login()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Login(string pass)
        {
            if (pass == ConfigurationManager.AppSettings["AccessPassword"])
            {
                Session["IsAnonimous"] = false;

                return RedirectToAction("Index", "Home");
            }

            Session["IsAnonimous"] = true;

            return View();
        }
    }
}
